

testGetScreen=function()
  local w,h = getScreenSize()
  print("w:"..w.." H:"..h)
end

init(0)
testGetScreen()


testClick=function()
  touchDown(97,591)
  --for i = 0, 300, 50 do 
   -- touchMove(97, 591+i); 
 -- end
  mSleep(20)--休眠20毫秒
  
  touchUp(97,591)
end

--testClick()

testTouchBack=function()
  touchBack()
end

--testTouchBack()

testTouchHome=function()
  touchHome()
end

--testTouchHome()

testOpenUrl=function()
  openUrl("http://www.baidu.com")
end
--testOpenUrl()

testGetInPutMethod=function()
  local m=getInPutMethod()
  print(m)
end

--testGetInPutMethod()

testSetInPutMethod=function()
  local m=setInPutMethod("com.baidu.input_mi/.ImeService")
  print(m)
end

--testSetInPutMethod()

testInstall=function()
 local m= install("手机排名牛1.1.1.apk")--D:\\items\\touchapk\\src\\test\\java\\com\\touchapk\\
   print(m)
end
--testInstall()

testUnInstall=function()
 local m= unInstall("com.paimingniu")
   print(m)
end
--testUnInstall()

testGetInstalledApps=function()
   local list=getInstalledApps()
   for i=1,#list do
    print(list[i])
   end
end
--testGetInstalledApps()
testAppBundlePath=function()
  local p=appBundlePath("org.opencv.samples.colorblobdetect")
  print(p)
end
--testAppBundlePath()

testGetAppVersionInfo=function()
  local c,n=getAppVersionInfo("com.taobao.taobao")
  print(c.."<>"..n)
end

--testGetAppVersionInfo()

testGetAppStartBid=function()
 local p=getAppStartHandle("com.taobao.taobao")
 print(p)
end

--testGetAppStartBid()

print(os.date("%Y-%m-%d", os.time()))

mtestClick=function(x,y)
  touchDown(x,y)
  --for i = 0, 300, 50 do 
   -- touchMove(97, 591+i); 
 -- end
  mSleep(20)--休眠20毫秒
  
  touchUp(x,y)
end

testFindText=function()
 local array = {"天猫国际"}
 local x,y=findText(array,30,60)
 if x~=-1 then
 mtestClick(x,y)
 end
 print(x.."<>"..y)
 end
 
print(os.date("%c", os.time()))
-- testFindText()
print(os.date("%c", os.time()))


testfindColor=function()
  local result=findColor("#0055ff")
  for i=1,#result do
  print("x:"..result[i]["x"].." y:"..result[i].y)
  end
end
testfindColor()

testfindColorRefer=function()
   local result=findColorRefer("#f71f8b")
  for i=1,#result do
  print("x:"..result[i]["x"].." y:"..result[i].y)
  end
 local x=result[1].x
 local y=result[1].y
 print(x.."<-->"..y)
  touchDown(x,y)
  --mSleep(20)--休眠20毫秒
  touchUp(x,y)
end  
--testfindColorRefer()
--testing 

